package cn.ddd.linktran.infrastructure.token.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;
@TableName("access_token")
public class AccessToken {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "app_id",  insertStrategy = FieldStrategy.NOT_NULL)
    private String appId;

    @TableField(value = "app_secret", insertStrategy = FieldStrategy.NOT_NULL)
    private String appSecret;

    @TableField(value = "access_token", insertStrategy = FieldStrategy.NOT_NULL)
    private String accessToken;

    @TableField(value = "access_token_expire_timestamp", insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime accessTokenExpireTimestamp;

    @TableField(value = "old_access_token", insertStrategy = FieldStrategy.NOT_NULL)
    private String oldAccessToken;

    @TableField(value = "old_access_token_expire_timestamp", insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime oldAccessTokenExpireTimestamp;

    @TableField(value = "available_count", insertStrategy = FieldStrategy.NOT_NULL)
    private Integer availableCount;

    @TableField(value = "datachange_createtime",
            insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime datachangeCreatetime;

    @TableField(value = "datachange_lasttime",
            insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime datachangeLasttime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public LocalDateTime getAccessTokenExpireTimestamp() {
        return accessTokenExpireTimestamp;
    }

    public void setAccessTokenExpireTimestamp(LocalDateTime accessTokenExpireTimestamp) {
        this.accessTokenExpireTimestamp = accessTokenExpireTimestamp;
    }

    public String getOldAccessToken() {
        return oldAccessToken;
    }

    public void setOldAccessToken(String oldAccessToken) {
        this.oldAccessToken = oldAccessToken;
    }

    public LocalDateTime getOldAccessTokenExpireTimestamp() {
        return oldAccessTokenExpireTimestamp;
    }

    public void setOldAccessTokenExpireTimestamp(LocalDateTime oldAccessTokenExpireTimestamp) {
        this.oldAccessTokenExpireTimestamp = oldAccessTokenExpireTimestamp;
    }

    public Integer getAvailableCount() {
        return availableCount;
    }

    public void setAvailableCount(Integer availableCount) {
        this.availableCount = availableCount;
    }

    public LocalDateTime getDatachangeCreatetime() {
        return datachangeCreatetime;
    }

    public void setDatachangeCreatetime(LocalDateTime datachangeCreatetime) {
        this.datachangeCreatetime = datachangeCreatetime;
    }

    public LocalDateTime getDatachangeLasttime() {
        return datachangeLasttime;
    }

    public void setDatachangeLasttime(LocalDateTime datachangeLasttime) {
        this.datachangeLasttime = datachangeLasttime;
    }

    @Override
    public String toString() {
        return "AccessToken{" +
                "id=" + id +
                ", appId='" + appId + '\'' +
                ", appSecret='" + appSecret + '\'' +
                ", accessToken='" + accessToken + '\'' +
                ", accessTokenExpireTimestamp=" + accessTokenExpireTimestamp +
                ", oldAccessToken='" + oldAccessToken + '\'' +
                ", oldAccessTokenExpireTimestamp=" + oldAccessTokenExpireTimestamp +
                ", availableCount=" + availableCount +
                ", datachangeCreatetime=" + datachangeCreatetime +
                ", datachangeLasttime=" + datachangeLasttime +
                '}';
    }
}
